<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition >

            <p:panel >
                <h:panelGrid columns="2" >
                    <p:commandButton id="btnSalvar" 
                                     value="Salvar F10" 
                                     icon="iconSalvar"
                                     action="#{albumBean.salvar()}"
                                     update=":geral,:geral:mensagem, :geral:pnlProcesso"
                                     />
                    <p:commandButton value="Voltar Esc"
                                     id="btnVoltar"
                                     action="#{albumBean.voltar()}"
                                     icon="iconFechar"
                                     update=":geral:pnlProcesso, :geral:mensagem"/>
                </h:panelGrid>
            </p:panel>


            <h:panelGrid columns="2">


                <h:outputLabel for="nome" value="Nome: *"/>
                <p:inputText id="nome" value="#{albumBean.album.nomeAlbum}" label="Nome" size="46"/>
                <h:outputLabel for="gravadora" value="Selo: "/>
                <p:selectOneMenu 
                    id="gravadora"
                    label="#{albumBean.album.seloid.nomeSelo}" 
                    value="#{albumBean.album.seloid}" 
                    style="width: 200px; height: auto">
                    <f:selectItems value="#{albumBean.selos}"/>
                    <f:converter converterId="SeloConversor"/>
                </p:selectOneMenu>
                <h:outputLabel for="anoGravacao" value="Ano de Gravação: "/>
                <p:calendar id="anoGravacao" 
                            required="true" 
                            pattern="dd/MM/yyyy" 
                            value="#{albumBean.album.anoGravacao}"/>
                <h:outputText value="Adicionar Capa: " />
                <p:fileUpload id="upload"
                              fileUploadListener="#{albumBean.uploadCapa}"
                              auto="true"
                              label="Buscar...">
                </p:fileUpload>
            </h:panelGrid>
        </ui:composition>

    </body>
</html>